import {Component} from "react";

class TodoItem extends Component {
    constructor(props) {
        super();
        this.state = {
            inputVal: '',
            list: [
                "learn react",
                "learn vue"
            ]
        }
        this.handleDelete = this.handleDelete.bind(this)
    }

    handleDelete() {
        console.log(this.props.index)
        this.props.delete(this.props.index)
    }

    render() {
        const {content} = this.props
        return (
            <div>
                <li onClick={this.handleDelete}>{content}</li>
            </div>
        );
    }
}

export default TodoItem;
